/**
 * @projectName study_java
 * @package State
 * @className State.NightWork
 */
package State;

/**
 * NightWork
 * @description 加班工作类
 * @author answer_wx
 * @date 2022/6/29 15:51
 * @version 1.0
 */
public class NightWork implements IState {
    @Override
    public void writeProgram(Work w) {
        if (w.isFinish()) {
            if (w.getHour() < 20) {
                System.out.println(String.format("当前时间%d：加班完成，早点回家", w.getHour()));
            } else if (w.getHour() < 22) {
                System.out.println(String.format("当前时间%d：回到家啦，洗洗睡觉", w.getHour()));
            } else {
                System.out.println(String.format("当前时间%d：打呼噜！！！", w.getHour()));
            }
        } else {
            System.out.println(String.format("当前时间%d：不干了，删库跑路！", w.getHour()));
        }
    }
}